import { post } from "../utils/requests";

const authURL = {
  addUserURL:'/register',
  loginURL:'/login',
}

// const authURL = {
//   addUserURL:'/FMS/register',
//   loginURL:'/FMS/login',
// }

/**
 * 添加新用户
 * @param {*} newUserInfo Object{userName, passWord, email, phone, }
 * @returns {status:string, msg:string, result:array}
 */
export function addUserApi(newUserInfo) {
  return post(authURL.addUserURL, newUserInfo);
}

/**
 * 登录
 * @param {*} userInfo Object{userName, userPwd}
 * @returns {status:string, msg:string, result:[role, token]}
 */
export function loginApi(userInfo){
  return post(authURL.loginURL, userInfo)
}

